[index]

Play File Command

Syntax

play file <sound_filename> [blocking]

Description

The play file command is actually a special instance of the play command. In this usage, play plays the specified sound file, directly from the operating system, through the computer's speaker. To play sound continuously while navigating between cards on different backgrounds, you must use the play file command. On the PC, the <filename> parameter must be the full pathname of a .WAV sound file. For example: C:\sounds\wav\bell.wav>. Replace the components of the full pathname example with the names of the directories in which your sound file is stored, and the specific name of the .WAV sound file. On the Macintosh, the <filename> parameter must be the full pathname of an .AIFF sound file. For example: <MacintoshHD>:sounds:aiff:<Sound file.aiff>. Replace the components of the full pathname example with the name of your Macintosh hard disk, each folder name, and the specific name of the .aiff sound file. If the blocking option is not specified, the sound is played asynchronously; the system does not wait for the sound to finish playing before returning control to the script. If blocking is specified, the sound must finish playing before control is returned to the script. The asynchronous playback is the default. If the sound played successfully, the value true is returned to it. If the sound did not play successfully, for example because the specified <filename> was not in the correct format, false is returned to it. For sound files to be played on a PC, the machine must be equipped with a sound card.

Notes

On Windows, if a sound object is playing a sound when the play file command is executed, play file fails. This is due to the fact that on Windows, only one sound can be played at a time. If you want to play sound continuously while navigating between cards on the same background, use the play file command with no option specified as an alternative to placing a sound object on the background.

Examples

The following button handler lets the user choose a sound from the operating system, then plays the chosen sound. on mouseUp type "WAV" if it is not empty then put it into the_sound play file the_sound end if
This text has been mechanically extracted from the Oracle Media Objects 1.0.4.9 MediaTalk Reference, © 1995 Oracle Corporation, and is provided here solely for educational/historical purposes.